package dfbz.homework7;

public class TestInvokeCalc {
    public static void main(String[] args) {
//        invokeCalc(3, 2, new Calculator() {
//            @Override
//            public int calc(int a, int b) {
//                return a-b;
//            }
//        });
        invokeCalc(3, 2,(a, b)->{ return a-b; });

    }
    private static void invokeCalc(int a, int b, Calculator calculator) {
        int result = calculator.calc(a, b);
        System.out.println("结果是：" + result);
    }
}
